﻿// ******************************************************************
// 项目名称 :WSPay
// 项目描述 :
// 文件名称 : RefundOrder.cs
// 版  本 : v1.0.0.0
// 说  明 :  
// 作  者 : mengzhong
// 邮  箱 :coodream@live.com
// 命名空间 : WSPay.Core
// 创建时间 : 2017.04.20.11:54
// 更新时间 : 2017.04.20.11:54
// ******************************************************************
//  Copyright meng zhong  2017. All rights reserved.
// ******************************************************************

using System;
using WSPay.Common;
using WSPay.Common.Data;

namespace WSPay.Domain
{
    public class RefundOrder : IEntity
    {
        public RefundOrder()
        {
            OrderId = "".RandomNo();
        }

        /// <summary>
        /// 流水号
        /// </summary>
        public int ID { get; set; }
        
        public string OrderId { get; set; }
        /// <summary>
        /// 支付訂單ID
        /// </summary>
        public string PaymentOrderId { get; set; }
        /// <summary>
        /// 支付通知订单ID
        /// </summary>
        public string NoticeSn { get; set; }
        /// <summary>
        /// 用户ID
        /// </summary>
        public Guid UserID { get; set; }
        /// <summary>
        /// 充值状态
        /// </summary>
        public RefundState State { get; set; }

        /// <summary>
        /// 退款金额
        /// </summary>
        public decimal Amount { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 最后更新时间
        /// </summary>
        public DateTime UpdateTime { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }

        /// <summary>
        /// 行级锁
        /// </summary>
        public byte[] RowVersion { set; get; }
        /// <summary>
        /// 任务ID
        /// </summary>
        public string JobId { get; set; }
        /// <summary>
        /// 返回RUL
        /// </summary>
        public string RuturnUrl { get; set; }

        public string NoticeUrl { get; set; }
        public string ClientID { get; set; }
        /// <summary>
        /// 支付宝流水号
        /// </summary>
        public string BatchNo { get; set; }
    }

    public enum RefundState
    {
        /// <summary>
        /// 等待处理
        /// </summary>
        [EnumItemDescription("等待处理")]
        Wait = 1,

        /// <summary>
        /// 完成
        /// </summary>
        [EnumItemDescription("完成")]
        Completed = 2,

        /// <summary>
        /// 失败
        /// </summary>
        [EnumItemDescription("失败")]
        Failure = 3,
    }
}